package com.hedl.practice.diyJava.junit.study_exception_tests.test;

public class Factorial {
    public static long fact(long n){
        if (n < 0){
            throw new IllegalArgumentException();
        }
        long r = 1;
        for (long i = 1; i <= n; i++){
            r*=i;
        }
        System.out.println(n);
        return r;
    }

    public static void main(String[] args) {
        fact(10);
        String os = System.getProperty("os.name").toLowerCase();
        if (os.contains("win")){
            System.out.println("windows系统");
        } else if (os.contains("mac")||os.contains("linux")||os.contains("unix")) {
            System.out.println("是mac，linux，unix中的一种");
        }
    }
}
